package com.lai.shop.controller;


import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
public class WebPageController {

    @GetMapping("/login.html")
    public String loginPage(){
        return "login";
    }

    @GetMapping("/register.html")
    public String registerPage(){
        return "register";
    }

    @GetMapping("/index.html")
    public String indexPage(){
        return "index";
    }

    @GetMapping("/cake.html")
    public String cakePage(@RequestParam("categoryName") String category, Model model){
        model.addAttribute("categoryName",category);
        return "cake_product";
    }

    @GetMapping("/flower.html")
    public String flowerPage(@RequestParam("categoryName") String category, Model model){
        model.addAttribute("categoryName",category);
        return "flower_product";
    }

    @GetMapping("/product.html")
    public String productPage(){
        return "product";
    }



}
